//
//  TSAuditListViewController.m
//  chart
//
//  Created by xu on 15/9/12.
//  Copyright (c) 2015年 xu. All rights reserved.
//

#import "TSAuditListViewController.h"
#import "TSSendMsgTableView.h"
#import "TSCreateMsgViewController.h"

@implementation TSAuditListViewController{
    TSSendMsgTableView *tableView;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(messageChangeOrPostSucceeded:) name:TSNotification_MessageChangeSucceeded object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(messageChangeOrPostSucceeded:) name:TSNotification_MessagePostSucceeded object:nil];
    
    self.navigationItem.title = @"审核列表";
    
    tableView = [[TSSendMsgTableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain IsAudit:YES];
    tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    [self.view addSubview:tableView];
}

/* 修改信息后更新发送列表 */
- (void)messageChangeOrPostSucceeded:(NSNotification *)noti
{
    if (tableView) {
        [tableView.header beginRefreshing];
    }
}

- (void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

@end
